using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using DBAccessLibrary.Model;
using QueryResource.Common;
using QueryResource.ViewModel;

namespace BaseControlLibrary
{
    [ValueConversion(typeof(bool), typeof(string))]
    public class IsNullConverter : IValueConverter
    {
        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool isNull = (bool)value;
            return isNull ? "Null" : "Not Null";
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string NullSrt = value.ToString();
            if (NullSrt == "Null")
                return true;
            return false;
        }
    }
}
